#!/bin/bash
# Kubernetes的交互客户端
# To interact with Kubernetes, you also need the kubectl CLI client
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=http://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=0
repo_gpgcheck=0
gpgkey=http://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg
       http://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF
 
sudo yum install -y kubectl

#kubectl cluster-info(查看集群信息)
#=> Kubernetes master is running at https://192.168.99.100:8443
#=> KubeDNS is running at https://192.168.99.100:8443/api/v1/proxy/...
#=> kubernetes-dashboard is running at https://192.168.99.100:8443/api/v1/...

#运行简单容器测试，minikube dashboard命令在linux下找不到浏览器。所以换了启动容器来检验是否能用。
#kubectl get pod
#kubectl run hello-minikube --image=k8s.gcr.io/echoserver:1.4 --port=8080
#kubectl get pod